<div class="films form">
<?php echo $this->Form->create('Film');?>
	<fieldset>
		<legend><?php echo __('Edit Film'); ?></legend>
	<?php
		echo $this->Form->input('id');
		echo $this->Form->input('title');
		echo $this->Form->input('synopsis');
		echo $this->Form->input('release_date');
		echo $this->Form->input('duration');
		echo $this->Form->input('Image');
		echo '<div id="accordion">';
			echo '<h3><a href="#" class="link_accordion">Actors</a></h3>';
			echo '<div>'.$this->Form->input('Actor',array('multiple'=>'checkbox', 'class'=>'check','label'=>false,'div'=>array('id'=>'select-actors')));
			echo $this->Ajax->link('New Actor',array('controller'=>'actors','action'=>'addAjax'),array('complete'=>'nuevo(request.responseText)','class'=>'new')).'</div>';
			
			
			echo '<h3><a href="#" class="link_accordion">Directors</a></h3>';
			echo '<div>'.$this->Form->input('Director',array('multiple'=>'checkbox', 'class'=>'check','label'=>false,'div'=>array('id'=>'select-directors')));
			echo $this->Ajax->link('New Director',array('controller'=>'directors','action'=>'addAjax'),array('complete'=>'nuevo(request.responseText)','class'=>'new')).'</div>';
			
			echo '<h3><a href="#" class="link_accordion">Genre</a></h3>';
			echo '<div>'.$this->Form->input('Genre',array('multiple'=>'checkbox', 'class'=>'check','label'=>false,'div'=>array('id'=>'select-genres')));
			echo $this->Ajax->link('New Genre',array('controller'=>'genres','action'=>'addAjax'),array('complete'=>'nuevo(request.responseText)','class'=>'new')).'</div>';
			
			$value='';
			foreach ( $this->data['Tag'] as $tag){
				$value=$value.$tag['tag'].'     ';
			}
			echo '<h3><a href="#" class="link_accordion">Tag</a></h3>';
			echo '<div>'.$this->Form->input('tag',array('value'=>$value,'readonly'=>'readonly'));//,array('class'=>'check','label'=>false,'div'=>array('id'=>'select-tags')));
			echo $this->Form->input('newTags',array('readonly'=>'readonly'));
			
			echo '<a href="#" class="new" id="nuevo-tag">New Tag <a/></div>';
			
			echo '<h3><a class="link_accordion">Related films</a></h3>';
			echo '<div>'.$this->Form->input('RFilm',array('multiple'=>'checkbox', 'class'=>'check','label'=>false));
			echo '</div>';
		
		echo '</div>';
	?>
	</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<div id="dialog-form">
</div>
<div id="dialog-tag" title="Add tag">
	<p id="validateTips">El tag debe tener loguitud mayor a cero</p>

	<form>
	<fieldset>
		
		<label for="tag">Tag</label>
		<input type="text" name="tag" id="new-tag" class="text ui-widget-content ui-corner-all" />
	</fieldset>
	</form>
</div>
